package com.edu.controller;

import com.edu.entity.Locations;
import com.edu.service.LocationsService;
import com.edu.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: graduate
 * @description:
 * @author: K.faWu
 * @create: 2021-05-31 21:44
 **/

@RestController
@RequestMapping("/locations")
public class LocationsController {
    @Autowired
    private LocationsService locationsService;

    /**
     * 省市区
     */
    @GetMapping("/{pid}")
    public Result get(@PathVariable Long pid){
        List<Locations> data = locationsService.getByPid(pid);
        return Result.success(data);
    }
}
